/**
 * @param {string[]} words1
 * @param {string[]} words2
 * @return {number}
 */
 var countWords = function(words1, words2) {
  const map = new Map()
  for(let s of words1){
    map.set(s, (map.get(s) || 0) + 1)
  }
  let s = new Set()
  for(let [k, v] of map.entries()){
    if(v === 1) s.add(k)
  }
  map.clear()
  for(let s of words2){
    map.set(s, (map.get(s) || 0) + 1)
  }
  let ans= 0
  for(let [k, v] of map.entries()){
    if(v === 1 && s.has(k)) ans++
  }
  return ans
};